<!DOCTYPE html>
<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">
<head>
    <div data-th-replace="layout/head-top"></div>
</head>
<body>
    <div class="ibox-content clearfix pt10">
        <div class="form-horizontal">
            <form id="groupForm">
                <input type="hidden" th:value="${sysGroup['id']}" name="id"/>
                <input type="hidden" th:value="${sysGroup['parentId']}" name="parentId"/>
                <div class="form-group">
                    <label class="col-sm-2 control-label text-right">
                        <i class="c-red">*</i> 部门名
                    </label>
                    <div class="col-sm-8">
                        <input type="text" class="form-control" th:value="${sysGroup['groupName']}" name="groupName"/>
                        <span class="help-block m-b-none c-999">部门名限30个字符以内</span>
                    </div>
                </div>
                <div class="hr-line-dashed"></div>
                <div class="form-group">
                    <label class="col-sm-2 control-label text-right">部门描述</label>
                    <div class="col-sm-8">
                        <textarea aria-required="true" style="height: 155px;resize: none;" class="form-control" name="depict" th:text="${sysGroup['depict']}"></textarea>
                        <span class="help-block m-b-none c-999">部门描述是对于该部门的具体说明</span>
                    </div>
                </div>
                <div class="hr-line-dashed"></div>
            </form>
            <div class="form-group">
                <label class="col-sm-2 control-label text-right mt10">选择部门权限</label>
                <div class="col-sm-8">
                    <div class="checkbox i-checks">
                        <label class="mt10"><input type="checkbox" id="all-function" value=""> <i></i> 全部系统与功能模块</label>
                    </div>
                </div>
            </div>
            <div class="hr-line-dashed"></div>
            <div class="all-functionBox" th:each="function : ${sysFunctionList}">
                <div class="form-group">
                    <label class="col-sm-2 control-label text-right parent-function-box">
                        <span class="checkbox i-checks">
                            <label>
                                <input type="checkbox" th:checked="${function['selected']}==true" class="all-function parent-function" name="functionIds" th:value="${function['id']}"/>
                                <span th:text="${function['functionName']}"></span>
                            </label>
                        </span>
                    </label>
                    <div class="col-sm-8 child-function-box">
                        <div class="checkbox i-checks">
                            <label class="pt10 show" th:each="child : ${function['childSysFunctionList']}">
                                <div class="inline">
                                    <input type="checkbox" th:checked="${child['selected']}==true" class="all-function child-function-two" name="functionIds" th:value="${child['id']}" />
                                    <span th:text="${child['functionName']}"></span>
                                </div>
                                <div class="m-l-md three-level-child">
                                    <!-- 三级目录-->
                                    <label class="pt10" th:each="_child,childStat : ${child['childSysFunctionList']}">
                                        <input type="checkbox" th:checked="${_child['selected']}==true" class="all-function child-function-three" name="functionIds" th:value="${_child['id']}" />
                                        <span th:text="${_child['functionName']}"></span>
                                        <th:block th:if="${childStat.last}">
                                            <br>
                                        </th:block>
                                    </label>
                                </div>
                            </label>

                            <label th:if="${function['childSysFunctionList']}==null or ${#lists.size(function['childSysFunctionList'])}==0" class="mt10">
                                <span class="help-block m-b-none c-orange ml10" th:text="'【'+${function['functionName']}+'】无子级权限'"></span>
                            </label>
                        </div>
                    </div>
                </div>
                <div class="hr-line-dashed"></div>
            </div>
        </div>
    </div>
    <div data-th-replace="layout/head-footer"></div>
    <script th:src="@{{path}/admin/business/manage/group/save_sys_group.js?v={v}(path=${staticPath},v=${v})}"></script>
    <script>
        $(function(){
            //初始化下拉框的搜索输入,如果不重新初始化下拉框样式不加载
            initSelectSearch();
        });
    </script>
</body>
</html>
